package com.wyix.common;

import lombok.Data;

import java.util.List;

/**
 * 分页响应结果封装
 */
@Data
public class PageResult<T> {
    /**
     * 总记录数
     */
    private long total;

    /**
     * 总页数
     */
    private int pages;

    /**
     * 当前页码
     */
    private int pageNum;

    /**
     * 每页条数
     */
    private int pageSize;

    /**
     * 当前页数据列表
     */
    private List<T> list;

    public PageResult(long total, int pages, int pageNum, int pageSize, List<T> list) {
        this.total = total;
        this.pages = pages;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.list = list;
    }
}